import React, {useEffect, useState} from 'react';
import {useParams} from "react-router-dom";
import {TreeSelect} from "antd"
import {getDepartmentByHoscode} from "@/api/hosp";
function Index() {
    const {hoscode} = useParams();
    const { TreeNode } = TreeSelect;
    const [departmentList,setDepartmentList] = useState([]);
    useEffect(() => {
        getDepartmentByHoscode(hoscode as string).then(value=>{
            console.log(value)
            setDepartmentList(value.data);
        })
    }, [])
    return (
        <div>
            <TreeSelect
                showSearch
                style={{ width: '100%' }}
                dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                placeholder="请输入医院科室"
                allowClear
                onChange={() => {

                }}
            >
                {

                }
            </TreeSelect>
        </div>
    );
}

export default Index;